<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="./js/jquery-3.4.1.min.js" type="application/javascript"></script>
<script type="application/javascript">
    $(function () {
          $(".del").click(function (event) {
              var isflag=confirm(`是否确认删除`)
              if(isflag){
                  let id=event.target.name
                  $.ajax({
                      url:"/user",
                      data:{
                          type: "delUser",
                          id:id
                      },
                      type:"GET",
                      dataType:"json",
                      success:function (data) {
                          if(data.status==200){
                              alert(data.msg)
                              location.href="/user?type=userIndex"
                          }
                      }
                  })
              }else {
                  alert("取消成功...")
              }
          })
    })
</script>
<body>
    <c:forEach var="res" items="${resourcesList}" varStatus="s">
        <span>${res.id}</span>
        <span><a href="${res.resUrl}">${res.resName}</a></span>
       <%-- <a class="del" name="${res.id}" href="javascript:void (0)">删除</a>
        <a href="/user?type=getUserById&id=${res.id}">修改</a>--%>
        <br>
    </c:forEach>

</body>
</html>
